#pragma once

#include <iostream>
#include <string>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>


int Opendev(const std::string& filename,int flags)
{
    int fd = open(filename.c_str(),flags);
    if(fd < 0)
    {
        std::cerr << "open file fail" << std::endl;
        return -1;
    }
    return fd;
}